package com.javase.Homework;

public class Homework05 {
    public static void main(String[] args) {
        Circle circle = new Circle(3);
    }
}
class Circle{
    double radius;
    public Circle(double radius){
        this.radius = radius;
        circumference();
        area();
    }
    public void circumference(){
        double cir = 2*3.14*this.radius;
        System.out.println("周长为"+cir);
    }
    public void area(){
        double area = 3.14*(this.radius*this.radius);
        System.out.println("面积为"+area);
    }
}
